layui.use(['form', 'jquery', 'layer'], function () {
    var form = layui.form,
        layer = layui.layer,
        $ = layui.jquery;
    //加载下拉框
    $.ajax({
        type: "get",
        url: ctx + "/emp/selectDesignerEmpByRoleInRoleName?roleName=" + "technology",
        data: {},
        success: function (data) {
            var opt;
            if (data != null) {
                for (var i = 0; i < data.length; i++) {
                    opt = "<option value='" + data[i].id + "'  >" + data[i].name + "</option>";
                    $("#designEmpId").append(opt);
                }
                form.render("select")
            }
        }
    });


    form.on('submit(addEmpToApproveFilter)', function (data) {
        var formData = data.field;
        var url = ctx + "/design/updateEmpByProjectDesign";
         console.log(formData)
        $.ajax({
            type: "post",
            data: formData,
            url: url,
            success: function (data) {
                if (data.code == 200) {
                    layer.msg(data.msg, {icon: 6})
                    layer.closeAll("iframe");
                    parent.location.reload();
                } else {
                    layer.msg(data.msg);
                }
            }, error: function (data) {
                layer.msg(data.msg)
            }
        })
        return false;
    })

});